<?php
namespace Hphp\Router;

use Hphp\Foundation\Application;

/**
 * Class ControllerDispatcher
 * @package Hphp\Router
 * 控制器分发对像
 */
class ControllerDispatcher
{
    /**
     * @var \Hphp\Foundation\Application
     */
    protected $app;

    public function __construct(Application $app )
    {
        $this->app = $app;
    }

    /**
     * 控制器分发
     * @param  Route  $route
     * @param  string $controller 控制器的地址
     * @param  string $method     控制住的方法
     */
    public function dispatcher(Route $route, $controller, $method)
    {
        return $controller->{$method}();
    }
}